package com.myproject.filmrecommendationsys.util;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration

public class SwaggerConfig {
    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.OAS_30) // v2 不同
                .select()
//                .apiInfo(apiInfo())
                .apis(RequestHandlerSelectors.basePackage("com.myproject.filmrecommendationsys.controller")) // 设置扫描路径
                .build();
    }


    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("影视推荐")
                .description("用于影视推荐系统的后端接口")
                .version("1.0")
                .build();
    }

}
